{
 Makarova Liza
 25.09.12
 Programma proveryaet legit li tochka vnutri mnogougolnika.
}
program Point;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  x, y: array of integer;
  x0, y0, i, sum, S, n: integer;
  fin: textFile;

begin
  assignFile (fin, 'input.txt');
  reset (fin);
  readln (fin, n);
  setlength (x, n);
  setlength (y, n);
  for i:= 1 to n do
    readln(fin, x[i], y[i]);
  readln (x0, y0);
  for i:= 1 to n do
    sum:= sum + (abs(2*(x[i+1] - x[i]) * (y[i+2] - y[i]) - ((x[i+2] - x[i]) * (y[i+2] - y[i]) + (x[i+1] - x[i+2]) * (y[i+2] - y[i+1]) + (x[i+1] - x[i]) * (y[i+1] - y[i]))));
  for i:= 1 to n do
    S:= S + (abs(2*(x[i+1] - x[i]) * (y0 - y[i]) - ((x0 - x[i]) * (y0 - y[i]) + (x[i+1] - x0) * (y0 - y[i+1]) + (x[i+1] - x[i]) * (y[i+1] - y[i]))));
  if (S<sum) then
    writeln ('The point belongs polygon')
  else
    writeln ('The point does not belong polygon');  
  writeln (n);
  closeFile (fin);
  readln;
end.

